

<?php
	

	include("../inc/joomlaInt_admin.php");
	include("../inc/inc_configuration.php");
	
if ($jUser==0)
{
	echo "Bitte zuerst einloggen!";
}
else
{	

	$q="SELECT gid FROM $tbl_users WHERE id=$jUser";
					$qe=mysql_query($q);
					$qeo=mysql_fetch_object($qe);
					
					$gid=$qeo->gid;
					
					if ($gid!=$admingroup)
					{
						echo "Du bist kein Admin!";
						break;
					}
					
	$liga=$_SESSION["liga"];
	$matchday=$_POST["matchday"];
	$gruppe=$_POST["gruppe"];
	$ref=$_POST["ref"];
	
	if ($ref!=1)
	{
		$lq = "UPDATE $tbl_matches set free=1 WHERE leagueId=$liga AND matchday<=$matchday AND free=0";
		$t="ligaspiele.php?liga=$liga&matchday=$matchday";
	}
	else
	{
		$lq = "UPDATE $tbl_matches set free=1 WHERE leagueId=$liga AND stageId=$gruppe AND matchday<=$matchday AND free=0";
		$t="gruppenspiele.php?gruppe=$gruppe&matchday=$matchday";
	}
	
	$lqe = mysql_query($lq);

	
	echo 'Sie werden weitergeleitet... <meta http-equiv="refresh" content="0; URL=',$t,'">   ';
}	
?>
